package com.skytech.tax.customsdatawarehouse.singlewindow.customsdeclarations.domain.entity;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

/**
 * @author Lianhong
 * @since 2021/6/10
 */
public class SingleWindowCustomsDeclaration implements Serializable {

    private String cusCiqNo;              //统一编号
    private String updateTime;            //更新时间
    private String cusDecStatus;          //报关状态
    private String socialCreditCode;        //企业社会信用代码

    private JSONObject customsDeclaration;  //进出口报关单详细信息

    public String getCusCiqNo() {
        return cusCiqNo;
    }

    public void setCusCiqNo(String cusCiqNo) {
        this.cusCiqNo = cusCiqNo;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getCusDecStatus() {
        return cusDecStatus;
    }

    public void setCusDecStatus(String cusDecStatus) {
        this.cusDecStatus = cusDecStatus;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }

    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    public JSONObject getCustomsDeclaration() {
        return customsDeclaration;
    }

    public void setCustomsDeclaration(JSONObject customsDeclaration) {
        this.customsDeclaration = customsDeclaration;
    }

    public IECustomsDeclaration buildCustomsDeclaration() {
        if (StringUtils.isEmpty(this.cusCiqNo) || this.customsDeclaration == null) return null;
        return new IECustomsDeclaration(this.cusCiqNo, this.socialCreditCode, this.customsDeclaration);
    }

    public IECustomsDeclarationSimple buildCustomsDeclarationSimple() {
        if (StringUtils.isEmpty(cusCiqNo) || StringUtils.isEmpty(updateTime) || StringUtils.isEmpty(cusDecStatus))
            return null;
        return new IECustomsDeclarationSimple(cusCiqNo, updateTime, cusDecStatus);
    }
}
